package aaaBlogger;

 
 
 
import java.io.File;
import java.util.function.Function;

import org.openqa.selenium.firefox.FirefoxDriver;

 






 





 


import com.attilax.cmsPoster.BlogPubberMainform;
import com.attilax.exception.ExUtil;
//import com.attilax.formH5.SwtLauncher;
import com.attilax.io.pathx;
import com.attilax.poster.jetty4boxSys;
import com.attilax.process.ProcessX;
import com.attilax.util.PropX;


/**
 * 
 * @author attilax
 *2016骞�4鏈�1鏃� 涓嬪崍11:05:16
 */
public class BloggerGui  {

 
/**
 * http://localhost:8009/blogger/index.html
 * @author attilax  2016骞�4鏈�1鏃�  涓嬪崍11:08:36
attilax    2016骞�4鏈�1鏃�  涓嬪崍11:06:10
 * @param args
 */
	public static void main(String[] args) {
	//	org.
		 
	//	BlogPubberMainform
		jetty4boxSys srv = new jetty4boxSys().setPort(8009);
		String url="http://localhost:"+String.valueOf(srv.port)+"/blogger/index.html";
		String broser = "C:\\Users\\Administrator\\AppData\\Roaming\\360se6\\Application\\360se.exe";
		String cfg_path=pathx.webAppPath_jensyegeor()+"/blogger/cfg.txt";
		PropX px=new PropX(cfg_path);
		String ses=px.getProperty("browser");
		String[] ssa=ses.split(",");
		String finalSe="";
		for (String string : ssa) {
			if(new File(string).exists())
			{
				finalSe=string;break;
			}
		}
		if(!new File(finalSe).exists())
			ExUtil.throwEx("se not exist");
		//finalSe=broser;
		String brsr=System.getProperty("browser",finalSe);
		final String cmd = brsr +"   "+ url;
		System.out.println(cmd);
	//	
		
		Function f=	new Function () {

			@Override
			public Object apply(Object t) {
				new ProcessX().exe(cmd);
				return null;
			}
		};
		
		
		srv	.startX(f);
	//	sun.security.x509.certa
	//	sun.security.x509.CertAndKeyGen
		System.out.println("get".toLowerCase().equals(""));
	//	org.openqa.selenium.firefox.internal.Executable
		pathx.isWebPathMode=true;
	//	String $s="abcdefg";
	System.out.println("");
	//	driver.get(baseUrl + "");
	//http://localhost:8009/blogger/index.html

//	BlogPubberMainform ef=new BlogPubberMainform();
//	ef.setSize(1200, 800);
//		ef.show();
//		ef.threadRecycle();

	}

}
